<style type="text/css">
.row { margin-left:0; }
</style>
<?php
/* @var $this StaticPagesController */
/* @var $model StaticPages */

$this->breadcrumbs=array(
	'Static Pages'=>array('admin'),
	'Manage',
);

$this->menu=array(
	//array('label'=>'List StaticPages', 'url'=>array('index')),
	array('label'=>'Create Static Page', 'url'=>array('create')),
	array('label'=>'Manage Static Pages', 'url'=>array('admin')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#static-pages-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");

//echo '<pre>'; print_r($_SERVER); exit;
?>

<h3>Manage Satic Pages</h3>
<?php 
//$url = ;
//print(str_replace("/backend/www/", "/", Yii::app()->getBaseUrl(true)));

// $url;exit;
?>

<?php //echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>


<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'id'=>'static-pages-grid',
	'type'=>'striped bordered condensed hover',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	//'filter'=>$model,
	
	'columns'=>array(
	 	// 'category_id',
		array('header'=>'Sr No.',
			'value'=>'++$row',
			),
			/*
			array(
           
            'name' => 'category_id',
            'value' => '$data->category->term_name',
             'filter'=>CHtml::dropDownList(
	        		'StaticPages[category_id]',
	        		$model->category_id,
	        		CHtml::listData(Terms::model()->findAllByAttributes(array(),array('order'=>'termID DESC')), 'termID', 'term_name'),
	        			array('empty' => '-- Terms --')),
        ),*/
		array(
		'header'=>'Term',
		'name'=>'category_id',
		'value'=>'Terms::model()->find(array("condition"=>"termID=:id", "params"=>array(":id"=>$data->category_id)))->term_name',
		),
	 	array(
			'name' => 'title',
			'type'=>'raw',
      		'value' => '$data->title',
	 		//'htmlOptions'=>array("width"=>"380px"),
		),	
		'type',
		array(
            'name' => 'attachment',
		 	'type'  => 'raw',
			'value'=>'($data->attachment!="")? CHtml::image(ApplicationConfig::app()->params["url_path"]["staticpagesSmall"].$data->attachment,"",array("style" => "width: 50px;height:40px;","align"=>"center")) : ""',
		 	'htmlOptions' => array("style" => "width: 50px;height:40px;","align"=>"center"),
		 	'filter'=>false,
         ),
         
	 	array(
			'name' => 'created_date',
			'type'=>'raw',
      		'value' => 'date("j.M.Y G:i A", strtotime($data->created_date))',
	 		'htmlOptions'=>array("width"=>"80px"),
		),
		array(
		'name'=>'status',
		'value'=>'($data->status==1)?"Enable":"Disable"',
		'filter'=>false,
		),		
		//'text_body', 
		//'html_body',
		array(
			'class'=>'bootstrap.widgets.TbButtonColumn',
			'template'=>'{update}{delete}',
			/*'buttons'=>array(
					'update'=>array(
							 //'url'=>'Yii::app()->createUrl("vendor/update/category_id/5")', 
							 'options'=>array(),),
					'Remove'=>array(
							 'url'=>'Yii::app()->createUrl("vendor/menuCategory/remove/id/$data->id")', 
							 'options'=>array('id'=>'delete_buttons'),
							 'imageUrl'=>"$remove_url_image",),				
									
					'ManageMenu'=>array(
							 'url'=>'Yii::app()->createUrl("vendor/menuItems/index/category_id/$data->id")', 
							 'options'=>array('id'=>'delete_buttons'),
							 'imageUrl'=>"$ManageMenu_url_image",),
							), 		*/
								
		),
	),
)); ?>



<!-- 
<div class="search_filter email_search_filter search-form" style="display: none;">

<?php // $form=$this->beginWidget('CActiveForm', array(
	//'action'=>Yii::app()->createUrl($this->route),
	//'method'=>'get',
 //)); ?>

	<div class="row">
		<?php // echo $form->label($model,'id'); ?>
		<?php // echo $form->textField($model,'staticpage_id',array('size'=>45,'maxlength'=>45)); ?>
	</div>

	<div class="row">
		<?php // echo $form->label($model,'title'); ?>
		<?php // echo $form->textField($model,'title',array('size'=>60,'maxlength'=>200)); ?>
	</div>

	<div class="clr">&nbsp;</div>
	<div class="form-actions" style="width:100%;">
		<?php // echo CHtml::submitButton('Search',array('class'=>'btn btn-primary')); ?>
	</div>

<?php // $this->endWidget(); ?>

</div> 
 -->
